package org.javaboy.vhr.controller;

import org.javaboy.vhr.model.TrainRecord;
import org.javaboy.vhr.service.TrainRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/trainrecord")
public class TrainRecordController {
    @Autowired
    TrainRecordService trainRecordService;


    @PostMapping("/notallowtrain")
    public int  addtrainrecord(@RequestBody TrainRecord trainRecord){
        return trainRecordService.addtrainrecord(trainRecord);
    }

    @GetMapping("/")
    public TrainRecord getTrainrecordById(Integer id){
        return trainRecordService.getTrainrecordById(id);
    }
}
